/****************************************************
 * 
 * home soft 版权所有.
 * 
 *****************************************************/

package com.homesoft.runtime.log;

/**
 * @author lihg
 * @data   2012-9-12
 */
public interface ILog {
	
	String getModuleName();

    /// <summary>
    /// 是否可以写跟踪日志，传入的logLevel的值和配置文件中相比较，传入值大于配置值则true,否则false
    /// </summary>
    /// <param name="logLevel"></param>
    /// <returns></returns>
    boolean EnableWriteTraceLog(LogLevel logLevel);

    /// <summary>
    /// 是否可以写系统日志，传入的logLevel的值和配置文件中相比较，传入值大于配置值则true,否则false
    /// </summary>
    /// <param name="logLevel"></param>
    /// <returns></returns>
    boolean EnableWriteSystemLog(LogLevel logLevel);

    /// <summary>
    /// 写异常日志,除了记录输入Exeception信息，内部记录了模块名称(ModuleName),请求ID(RequestID),当前操作者ID(UserID),创建时间(CreateTime)
    /// </summary>
    /// <param name="exception">异常</param>
    /// <param name="message">日志内容</param>
    /// <param name="args">参数值</param>
    void WriteExceptionLog(Exception exception, String message);

    /// <summary>
    /// 写异常日志,除了记录输入Exeception信息，内部记录了模块名称(ModuleName),请求ID(RequestID),当前操作者ID(UserID),创建时间(CreateTime)
    /// </summary>
    /// <param name="exception">异常</param>
    void WriteExceptionLog(Exception exception);
    
    /// <summary>
    ///  写跟踪日志,除了记录输入参数信息，内部记录了模块名称(ModuleName),请求ID(RequestID),当前操作者ID(UserID),创建时间(CreateTime)
    /// </summary>
    /// <param name="logLevel">级别</param>
    /// <param name="message">日志内容</param>
    /// <param name="args">参数值</param>
    void writeTraceLog(LogLevel logLevel, String message);

    /// <summary>
    ///  写跟踪日志,除了记录输入参数信息，内部记录了模块名称(ModuleName),请求ID(RequestID),当前操作者ID(UserID),创建时间(CreateTime)
    /// </summary>
    /// <param name="logLevel">级别</param>
    /// <param name="message">日志内容</param>
    /// <param name="args">参数值</param>
    long beginWriteTraceLog(LogLevel logLevel, String message);

    /// <summary>
    ///  写跟踪日志,除了记录输入参数信息，内部记录了模块名称(ModuleName),请求ID(RequestID),当前操作者ID(UserID),创建时间(CreateTime)
    /// </summary>
    /// <param name="beginLogId">通过调用BeginWriteTraceLog获得</param>
    /// <param name="logLevel">级别</param>
    /// <param name="message">日志内容</param>
    /// <param name="args">参数值</param>
    void endWriteTraceLog(long beginLogId, LogLevel logLevel, String message);

    
    void writeSystemLog(LogLevel logLevel, String message);
}
